#include <bits/stdc++.h>
using namespace std;

const int N = 1e7 + 1;
using ll = long long;
ll dp[N], mod = 1e9 + 7;

int main()
{
	int n;
	cin >> n;
	dp[1] = 1;
	dp[2] = 2;
	dp[3] = 5;
	for (int i = 4; i <= n; i++)
		dp[i] = ((2 * dp[i - 1]) % mod + dp[i - 3]) % mod;
	cout << dp[n] << endl;
	return 0;
}
